package com.um.jdy.platform.device.controller;

import com.um.jdy.common.device.entity.dto.PileDTO;
import com.um.jdy.common.device.entity.po.Pile;
import com.um.jdy.common.device.entity.vo.PileVO;
import com.um.jdy.common.device.service.PileService;
import com.um.jdy.platform.device.entity.dto.SetEBoxParamsDTO;
import com.um.jdy.platform.device.entity.dto.SetEVParamsDTO;
import com.um.jdy.platform.device.entity.dto.SetPBParamsDTO;
import com.um.jdy.platform.device.entity.dto.SetEBParamsDTO;
import com.um.jdy.platform.device.manger.PileParamsManager;
import com.um.springboot.starter.annotation.ApiPermission;
import com.um.springboot.starter.annotation.TokenRequired;
import com.um.springboot.starter.orm.controller.BaseCMSController;
import com.um.springboot.starter.orm.controller.BaseController;
import com.um.springboot.starter.orm.entity.Response;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 控制器：充电桩参数
 */
@RestController
@RequestMapping("/api/v1/cms/device/params")
@Api(tags = "设备管理", description = "充电桩参数")
@ApiPermission("device_params")
@TokenRequired
@Validated
public class PileParamsController extends BaseController<PileParamsManager> {

    /**
     * 设置单车桩参数
     * @param setEBParamsDTO
     * @return
     */
    @ApiPermission("eb")
    @ApiOperation("设置单车桩参数")
    @PostMapping("/eb/XH_TCP_1.0")
    public Response setEBParams(@RequestBody SetEBParamsDTO setEBParamsDTO) {
        return manager.setEBParams(setEBParamsDTO);
    }

    /**
     * 设置充电柜参数
     * @param setEBoxParamsDTO
     * @return
     */
    @ApiPermission("ebox")
    @ApiOperation("设置充电柜参数")
    @PostMapping("/ebox/XH_TCP_1.0")
    public Response setEBoxParams(@RequestBody SetEBoxParamsDTO setEBoxParamsDTO) {
        return manager.setEBoxParams(setEBoxParamsDTO);
    }

    /**
     * 设置汽车桩参数
     * @param setEVParamsDTO
     * @return
     */
    @ApiPermission("ev")
    @ApiOperation("设置汽车桩参数")
    @PostMapping("/ev/YKC_1.6")
    public Response setEVParams(@RequestBody SetEVParamsDTO setEVParamsDTO) {
        return manager.setEVParams(setEVParamsDTO);
    }

    /**
     * 设置充电宝参数
     *
     * @param setPBParamsDTO
     * @return
     */
    @ApiPermission("pb")
    @ApiOperation("设置充电宝参数")
    @PostMapping("/pb/XH_TCP_1.0")
    public Response setPBParams(@RequestBody SetPBParamsDTO setPBParamsDTO) {
        return manager.setPBParams(setPBParamsDTO);
    }

}
